/**
 * 获取URL的query参数
 * @param name
*/
function getParameterByName(name: string) {
  name = name.replace(/[\[]/, '\\\[').replace(/[\]]/, '\\\]')
  const regex = new RegExp(`[\\?&]${name}=([^&#]*)`)
  const results = regex.exec(location.search)
  return results == null ? '' : decodeURIComponent(results[1])
}

const from = useRouteQuery('fromType')
const secondWayToGetFrom = getParameterByName('fromType')

export default function useEntry() {
  switch (from.value) {
    case '1':
      break

    case '2':
      break

    case '3':
      break

    case '4':
      break

    default:
      break
  }
}
